package com.txx.app.main.modules.web.function;
import com.rsq.function.txxpluginsdk.user.TXXCommonSPUtils;
import com.txx.app.main.App;
import com.txx.app.main.modules.web.WebCommonFragment;
import com.txx.app.main.modules.web.js.H5BasePlugin;
import com.txx.app.main.modules.web.js.H5Event;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * created by houyl
 * on  6:51 PM
 */
public class Switch900Account extends H5BasePlugin {

    @Override
    public boolean handleEvent(H5Event h5Event, WebCommonFragment fragment) {
        if (h5Event == null) {
            return false;
        }
        try {
            String json = h5Event.getJsonSource ();
            JSONObject jsonObject = new JSONObject (json);
//            String callBackName = jsonObject.getString ("callBackName");
            boolean change = jsonObject.optBoolean("ifChange");
            TXXCommonSPUtils spUtils= new TXXCommonSPUtils (App.getContext (), "autoLogin");
            spUtils.put("yinbao_change_staffnumber",change);
        } catch (JSONException e) {
            e.printStackTrace ();
        } catch (Exception e) {
            e.printStackTrace ();
        }

        return true;
    }

    @Override
    public void onRelease() {

    }

    @Override
    public String getCallBackName() {
        return null;
    }


}
